<template>
  <div class="errands">
    <myHead title="跑腿"></myHead>
    <div class="amap-page-container">
      <el-amap vid="errands" :zoom="zoom" :center="center" >
        <el-amap-circle v-for="(circle,y) in circles" :key="y" :center="circle.center" :radius="circle.radius" :fill-opacity="circle.fillOpacity" :events="circle.events" fillColor="#5589fe" strokeOpacity="0"></el-amap-circle>
      </el-amap>
    </div>
    <div class="block"></div>
    <footer>
      <div class="footer">
        <div class="foot-top" @test="lq">
          <router-link v-for="(x,y) in assembleList" :to="x.page" tag="div" class="abList_box" :key="y" replace>
            <p :class="x.page==present?'ft-topname':'ft-topname ft-topnamed'">{{x.text}}</p>
            <transition name="el-zoom-in-center">
              <p v-show="x.page == present" class="gang"></p>
            </transition>
          </router-link>
          <div class="abList_box" @click="jump('helpBuy')">
            <p class="ft-topname ft-topnamed">帮我买</p>
          </div>
        </div>
        <router-view></router-view>
      </div>

    <!-- 物品信息选择 -->
      <div class="wpMsg">
        <div class="wpMsg-left">
          <p><img src="../../../static/img/ptws4.png" alt=""></p>
          <p>物品信息</p>
        </div>
        <div class="wpXuanze">
          <p>请选择物品信息</p>
          <img src="../../../static/img/youjiantou003.png" alt="">
        </div>
      </div>
    <!-- 其余信息选择 -->
      <div class="qyWrap">
        <div class="wpMsg">
          <div class="wpMsg-left">
            <p><img src="../../../static/img/ptws3.png" alt=""></p>
            <p>发货时间</p>
          </div>
          <div class="wpXuanze">
            <p>立即送达</p>
            <img src="../../../static/img/youjiantou003.png" alt="">
          </div>
        </div>
        <div class="wpMsg">
          <div class="wpMsg-left">
            <p><img src="../../../static/img/ptws2.png" alt=""></p>
            <p>优惠</p>
          </div>
          <div class="wpXuanze">
            <p>暂无可用优惠券</p>
            <img src="../../../static/img/youjiantou003.png" alt="">
          </div>
        </div>
        <div class="wpMsg wpMsg1">
          <div class="wpMsg-left">
            <p><img src="../../../static/img/ptws1.png" alt=""></p>
            <p>订单备注</p>
          </div>
          <div class="wpXuanze">
            <p class="userMsg">
              <textarea name="" id="" cols="30"  placeholder="请填写需要备注的消息"></textarea>
            </p>
            <img src="../../../static/img/youjiantou003.png" alt="">
          </div>
        </div>
      </div>
    <!-- 支付入口 -->
      <div class="zfRukou">
        <div class="zfRukou-box">
          <p><span>￥</span>10.00</p>
          <div class="zfRukouBtn">
            <p>到付</p>
            <p>付款</p>
          </div>
        </div>
      </div>
    </footer>
    <!--    我的订单入口    -->
    <div class="myOrder" @click="jump('runOrderList')">
      <img src="../../../static/img/dingdanpt.png" alt="">
      <p>我的订单</p>
    </div>
  </div>
</template>

<script>
  import myHead from "../../components/ClientComponents/lib/myHead";
  export default {
    name: "errands",
    components:{
      myHead
    },
    data() {
      return {
        zoom: 15,
        center: [108.9903110000, 34.2025390000],
        circles: [
          {
            center: [108.9903110000, 34.2025390000],
            radius: 200,
            fillOpacity: 0.5,
            events: {
              // click: () => {
              //   alert('click');
              // }
            }
          }
        ],
        assembleList: [{text: '同校急送', page: 'giveSchool'}, {text: '帮我取', page: 'helpTake'}],
        present: 'giveSchool'
        }
    },
    mounted() {
      let str = this.$route.path;
      this.present = str.replace('/components/ClientComponents/errands/', '');
    },
    watch: {
      $route(to, from) {
        this.present = to.path.replace('/components/ClientComponents/errands/', '');
      }
    },
    methods: {
      jump(page) {
        this.$router.push({
          name:page
        })
      },
      lq(res){
        this.$on('test',res=>{
          console.log(res)
        })
      }
    }
  }
</script>

<style scoped>
  .errands {
    padding-top: .5rem;
    min-height: 6.17rem;
  }
  .amap-page-container {
    height: 5.87rem;
  }
  .block {
    width: 100%;
    height: .2rem;
    background-color: #ffffff;
    position: fixed;
    left: 0;
    bottom: .3rem;
    z-index: 999;
  }

  footer {
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    z-index: 99999;
    background-color: #F5F5F5;
    display: flex;
    flex-flow: column;
    align-items: center;
    padding-bottom: .1rem;
  }
  .footer {
    width:3.51rem;
    min-height: 2.2rem;
    background:rgba(255,255,255,1);
    box-shadow:0 .02rem .09rem 0 rgba(0, 0, 0, 0.18);
    border-radius:.05rem;
    box-sizing: border-box;
    padding: 0 .1rem;
  }
  .foot-top {
    width: 100%;
    box-sizing: border-box;
    padding: 0 .3rem;
    height: .6rem;
    display: flex;
    flex-flow: row;
    align-items: center;
    justify-content: space-around;
    border-bottom: .01rem solid #EFEFEF;
  }
  .abList_box {
    width: 100%;
    height: 100%;
    display: flex;
    flex-flow: column;
    justify-content: center;
    align-items: center;
    position: relative;
  }
  .ft-topname {
    width: 100%;
    text-align: center;
    font-size:.15rem;
    font-family:PingFang SC;
    font-weight:bold;
    color: #FF7611;
  }
  .ft-topnamed {
    color: #808080 !important;
  }
  .gang {
    width:.21rem;
    height:.02rem;
    background:linear-gradient(0deg,rgba(255,142,65,1) 0%,rgba(255,110,0,1) 100%);
    border-radius:.01rem .01rem .01rem .01rem;
    margin: 0 auto;
    position: absolute;
    bottom: .12rem;
    /*left: calc(50% - .1rem);*/
  }

  /* 我的订单入口 */
  .myOrder {
    position: fixed;
    top: calc(40% - .25rem);
    right: 3.2%;
    display: flex;
    flex-flow: column;
    align-items: center;
    justify-content: center;
    width: .55rem;
    height: .55rem;
    background: linear-gradient(90deg, rgba(255, 142, 65, 1), rgba(255, 142, 65, 1), rgba(255, 110, 0, 1));
    border-radius: 50%;
  }

  .myOrder > p {
    font-size: .1rem;
    font-family: PingFang SC;
    font-weight: 500;
    color: #FFFFFF;
  }

  .myOrder > img {
    width: .17rem;
    max-height: .2rem;
    margin-bottom: .02rem;
  }

/* 物品信息选择 */
  .wpMsg {
    width: 3.51rem;
    background-color: #FFFFFF;
    box-shadow:0 .01rem .04rem 0 rgba(0, 0, 0, 0.1);
    border-radius:.05rem;
    display: flex;
    flex-flow: row;
    align-items: center;
    justify-content: space-between;
    margin: .1rem auto;
  }
  .wpMsg-left {
    height: .55rem;
    display: flex;
    flex-flow: row;
    align-items: center;
  }
  .wpMsg-left>p:nth-child(1) {
    width: .45rem;
    height: 100%;
    display: flex;
    flex-flow: row;
    align-items: center;
    justify-content: center;
  }
  .wpMsg-left>p:nth-child(1)>img {
    width: .15rem;
    max-height: .13rem;
  }
  .wpMsg-left>p:nth-child(2) {
    font-size:.15rem;
    font-family:PingFang SC;
    font-weight:500;
    color: #333333;
  }

  .wpXuanze {
    width: 60%;
    box-sizing: border-box;
    padding: .1rem .1rem .1rem 0;
    min-height: .55rem;
    display: flex;
    flex-flow: row;
    align-items: center;
    justify-content: flex-end;
  }
  .wpXuanze>p:nth-child(1) {
    font-size:.14rem;
    font-family:PingFang SC;
    font-weight:400;
    color: #999999;
    margin-right: .1rem;
  }
  .wpXuanze>img {
    width: .05rem;
    height: .1rem;
  }

  .qyWrap>.wpMsg {
    margin: 0;
    border-radius: 0;
  }
  .userMsg>textarea {
    width: 100%;
    height: .4rem;
    resize: none;
    text-align: right;
    border: none;
  }
  .userMsg>textarea::placeholder {
    text-align: right;
    line-height: .4rem;
  }

  .wpMsg1 {
    align-items: flex-start;
  }

  /* 支付入口 */
  .zfRukou {
    width: 100%;
    background-color: #FFFFFF;
  }
  .zfRukou-box {
    height: .5rem;
    width: 100%;
    box-sizing: border-box;
    padding: 0 .1rem 0 .2rem;
    display: flex;
    flex-flow: row;
    align-items: center;
    justify-content: space-between;
  }
  .zfRukou-box>p:nth-child(1) {
    font-size:.24rem;
    font-family:PingFang SC;
    font-weight:500;
    color: #FF7611;
  }
  .zfRukou-box>p:nth-child(1)>span {
    font-size: .15rem;
  }
  .zfRukouBtn {
    display: flex;
    flex-flow: row;
    align-items: center;
  }
  .zfRukouBtn>p:nth-child(1) {
    width:.7rem;
    height:.3rem;
    box-sizing: border-box;
    border:.01rem solid rgba(255,118,17,1);
    font-size:.13rem;
    font-family:PingFang SC;
    font-weight:400;
    color: #FF7611;
    text-align: center;
    line-height: .3rem;
    border-radius:.16rem;
  }
  .zfRukouBtn>p:nth-child(2) {
    width:.7rem;
    height:.3rem;
    box-sizing: border-box;
    border:.01rem solid rgba(255,118,17,1);
    background:linear-gradient(0deg,rgba(255,142,65,1),rgba(255,110,0,1));
    box-shadow:0 .04rem .11rem 0 rgba(255,112,5,0.4);
    font-size:.13rem;
    font-family:PingFang SC;
    font-weight:400;
    color: #FFFFFF;
    text-align: center;
    line-height: .3rem;
    border-radius:.16rem;
    margin-left: .1rem;
  }
</style>
